import 'package:flutter/material.dart';
import 'Movie.dart';

class SelfListView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Self ListView')),
      body: Container(
        padding: EdgeInsets.only(top: 100),
        height: 338,
        child: ListView(
          scrollDirection: Axis.horizontal,
          children: <Widget>[
            GestureDetector(
              onTap: () {
                Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context){
                    return Movie(title: '攀登者', imgUrl: 'https://p0.meituan.net/170.230/movie/4c01895cfd53e82f7c3048c407974a6b4739229.jpg',);
                  }));
              },
              child: Container(
                width: 170,
                decoration: BoxDecoration(color: Colors.green),
                child: Image(
                  image: NetworkImage('https://p0.meituan.net/170.230/movie/4c01895cfd53e82f7c3048c407974a6b4739229.jpg'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context){
                    return Movie(title: '诛仙', imgUrl: 'https://p0.meituan.net/170.230/movie/845dce25ba800e91ac591b683a0c3ba92450317.jpg',);
                  }));
              },
              child: Container(
                width: 170,
                decoration: BoxDecoration(color: Colors.green),
                child: Image(
                  image: NetworkImage('https://p0.meituan.net/170.230/movie/845dce25ba800e91ac591b683a0c3ba92450317.jpg'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context){
                    return Movie(title: '小小的愿望', imgUrl: 'https://p0.meituan.net/170.230/movie/d18915868f6e3e6e287162354700690f2338229.jpg',);
                  }));
              },
              child: Container(
                width: 170,
                decoration: BoxDecoration(color: Colors.green),
                child: Image(
                  image: NetworkImage('https://p0.meituan.net/170.230/movie/d18915868f6e3e6e287162354700690f2338229.jpg'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context){
                    return Movie(title: '中国机长', imgUrl: 'https://p0.meituan.net/170.230/moviemachine/4de45617746dae456738bc322670cb88562422.jpg',);
                  }));
              },
              child: Container(
                width: 170,
                decoration: BoxDecoration(color: Colors.green),
                child: Image(
                  image: NetworkImage('https://p0.meituan.net/170.230/moviemachine/4de45617746dae456738bc322670cb88562422.jpg'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context){
                    return Movie(title: '罗小黑战记', imgUrl: 'https://p0.meituan.net/170.230/movie/0772ff70aafc57e0005535d4d7c93b112720771.jpg',);
                  }));
              },
              child: Container(
                width: 170,
                decoration: BoxDecoration(color: Colors.green),
                child: Image(
                  image: NetworkImage('https://p0.meituan.net/170.230/movie/0772ff70aafc57e0005535d4d7c93b112720771.jpg'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context){
                    return Movie(title: '名侦探柯南', imgUrl: 'https://p0.meituan.net/170.230/moviemachine/b7362f555340906684944957dfc8d5421530646.jpg',);
                  }));
              },
              child: Container(
                width: 170,
                decoration: BoxDecoration(color: Colors.green),
                child: Image(
                  image: NetworkImage('https://p0.meituan.net/170.230/moviemachine/b7362f555340906684944957dfc8d5421530646.jpg'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
